package com.processor;

import java.util.*;
import java.util.concurrent.ConcurrentHashMap;

/**
 * Created by del on 16-5-2.
 */
public class HistoryMap {

    public static ConcurrentHashMap<String,Boolean> authorMap = new ConcurrentHashMap<String, Boolean>();

    public static ConcurrentHashMap<String, Boolean> articleMap = new ConcurrentHashMap<String, Boolean>();

    public static void clearMap() {
        TimerTask task = new TimerTask() {
            @Override
            public void run() {
                authorMap.clear();
                articleMap.clear();
            }
        };
        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.HOUR_OF_DAY, 1);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        Date date = calendar.getTime();
        Timer timer = new Timer();
        timer.schedule(task, date);
    }
}
